package com.yl.chainStore.services

import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.yl.chainStore.entity.customer.CustomerDeptConfig
import com.yl.chainStore.entity.customer.CustomerInfo
import com.yl.chainStore.entity.pay.*
import com.yl.chainStore.entity.sick.CustomerSubscribeItem
import com.yl.chainStore.entity.sick.CustomerSubscribeLog
import com.yl.chainStore.entity.sick.SickCustomerAccessLog
import com.yl.chainStore.entity.sick.SickMedicalRecordsDetail
import com.yl.chainStore.entity.system.CompanyDeptOtherConfig
import com.yl.chainStore.entity.company.CompanySmsModelType
import com.yl.chainStore.entity.company.SickCustomerAccessLogModel
import com.yl.chainStore.entity.user.CompanyUserMedicalHistoryModelType
import com.yl.chainStore.entity.warehouse.TechnologyProcessing
import com.yl.chainStore.entity.warehouse.TechnologyProcessingPlant
import com.yl.chainStore.payrule.item.ItemRuleTypeEnum
import com.yl.chainStore.payrule.order.OrderRuleTypeEnum
import com.yl.chainStore.pojo.vo.company.SickCustomerAccessLogModelSelectVo
import com.yl.chainStore.pojo.vo.warehouse.TechnologyProcessingMapperVo
import com.yl.chainStore.pojo.vo.warehouse.UpdateItemConfigVo
import com.yl.common.control.ResponseBody
import com.yl.chainStore.pojo.vo.customer.CustomerSelectVo
import com.yl.chainStore.pojo.vo.pay.*
import com.yl.chainStore.pojo.vo.sick.CustomerSubscribeLogSelectVo
import com.yl.chainStore.pojo.vo.sick.SickCustomerAccessLogSelectVo
import com.yl.chainStore.pojo.vo.sick.SickMedicalRecordsDetailSelectVo

/**
 * @description :公司部门
 * @author :吴枫
 * @create :2021-07-05 10:55:00
 */
interface IWebCompanyDeptService  {
	/**
	 * 添加技加工订单
	 */
	fun processAdd(en: TechnologyProcessing): ResponseBody



	/**
	 * 查看技加工订单列表(分页)
	 */
	fun processListByPage(vo: TechnologyProcessingMapperVo): Page<TechnologyProcessing>

	/**
	 * 添加一个收费项目
	 */
	fun addPayItem(item: SysCompanyPayItem, vo: UpdateItemConfigVo): ResponseBody

	/**
	 * 修改一个收费项目
	 */
	fun updatePayItem(item: SysCompanyPayItem, vo: UpdateItemConfigVo): ResponseBody

	/**
	 * 查询公司客户分页
	 */
	fun getCustomerPage( vo: CustomerSelectVo): Page<CustomerInfo>

	/**
	 * 添加患者
	 */
	fun setDeptConfig(config: CustomerDeptConfig): ResponseBody

	/**
	 * 获取患者在分院的配置
	 */
	fun getCustomerDeptConfig(customerId: Long, subCompanyId: Long): CustomerDeptConfig?

	/**
	 * 设置分院病人的负责人
	 */
	fun setUserToCustomer(config: CustomerDeptConfig): ResponseBody

	/**
	 * 获取收费项目分页
	 */
	fun getPayItemPage(
		page: Page<SysCompanyPayItem>,
		vo: SystemCompanyPayItemSelectVo,
		deptId: Long
	): Page<SysCompanyPayItem>

	/**
	 * 获取收费项目列表
	 */
	fun getPayItemList(vo: SystemCompanyPayItemSelectVo, deptId: Long): List<SysCompanyPayItem>

	/**
	 * 获取收费项目类型列表
	 */
	fun getItemTypeList(vo: SysCompanyPayItemTypeSelectVo): MutableList<SysCompanyPayItemType>

	/**
	 * 查询分院的来访记录
	 */
	fun getMedicalRecordsPage(
		deptId: Long,
		page: Page<SickMedicalRecordsDetail>,
		vo: SickMedicalRecordsDetailSelectVo
	): Page<SickMedicalRecordsDetail>

	fun getMedicalRecordsCount(deptId: Long,vo: SickMedicalRecordsDetailSelectVo):Int

	/**
	 * 客户可以预约的项目
	 */
	fun getCustomerSubscribeItemList(): MutableList<CustomerSubscribeItem>

	/**
	 * 添加一个优惠卷模板
	 */
	fun createCustomerCouponsModel(model: PayCompanyCouponsModel): ResponseBody

	/**
	 * 查询优惠卷模板列表
	 */
	fun getCustomerCouponsModelList(vo: PayCompanyCouponsModelSelectVo): List<PayCompanyCouponsModel>

	/**
	 * 分公司收款
	 */
	fun collection(
		payCompanyCollectionLog: PayCompanyCollectionLog
	): ResponseBody

	/**
	 * 待付款列表
	 */
	fun toChargeList(vo: PayCustomOrderToChargeVo): Page<PayCustomerOrder>

	/**
	 * 待付款数量
	 */
	fun toChargeCount(vo: PayCustomOrderToChargeVo): Int

	/**
	 * 已收款列表
	 */
	fun hasChargeList(vo: PayCustomOrderToChargeVo): Page<PayCustomerOrder>

	/**
	 * 已收款数量
	 */
	fun hasChargeCount(vo: PayCustomOrderToChargeVo):Int

	/**
	 * 订单分页
	 */
	fun getOrderPage(vo: PayCustomerOrderSelectVo): Page<PayCustomerOrder>

	fun getOrderList(vo: PayCustomerOrderSelectVo): List<PayCustomerOrder>

	/**
	 * 取消预约列表
	 */
	fun cancelSubscribePage(vo: CustomerSubscribeLogSelectVo): Page<CustomerSubscribeLog>

	/**
	 * 分页查询回访，随访
	 */
	fun getAccessLogPage(
		page: Page<SickCustomerAccessLog>,
		vo: SickCustomerAccessLogSelectVo
	): Page<SickCustomerAccessLog>

	/**
	 * 分页查询回访，随访
	 */
	fun getAccessLogCount(
		vo: SickCustomerAccessLogSelectVo
	): Int

	/**
	 * 获取当天新增的患者
	 */
	fun getTodayNewCustomer(deptId: Long): Int

	/**
	 *  查询今日新增预约人数
	 */
	fun getTodayNewSub(deptId: Long): Int

	/**
	 * 今日实收金额
	 */
	fun getTodayNewCollection(deptId: Long): Long

	/**
	 * 随访人员
	 */
	fun getTodayNewAccessLog(deptId: Long): Int

	/**
	 * 今日就诊人数
	 */
	fun getTodayNewSickMedicalRecords(deptId: Long): Int

	/**
	 * 显示今日新增患者，新增预约，实收金额，随访人员，今日就诊
	 */
	fun todayStatistics(deptId: Long): Map<String, Any>

	/**
	 * 分页查询回访，随访
	 */
	fun getAccessLogList(vo: SickCustomerAccessLogSelectVo): List<SickCustomerAccessLog>

	/**
	 * 根据日期获取预约列表 当前的分院的
	 * 按日期数组形式返回
	 * [[],[obj,obj],[obj]]格式返回
	 */
	fun getSubScribeListByDate(vo: CustomerSubscribeLogSelectVo): List<List<CustomerSubscribeLog>>

	/**
	 * 根据获取预约列表
	 */
	fun getSubscribeLogList(vo: CustomerSubscribeLogSelectVo): List<CustomerSubscribeLog>

	/**
	 * 根据获取预约列表
	 */
	fun getSubscribeLogPage(vo: CustomerSubscribeLogSelectVo): Page<CustomerSubscribeLog>

	/**
	 * 根据获取预约数量
	 */
	fun getSubscribeLogCount(vo: CustomerSubscribeLogSelectVo): Int

	/**
	 * 添加项目优惠
	 */
	fun addItemPayDiscountRule(rule: PayCustomerOrderItemDiscountRule): ResponseBody

	/**
	 * 获取订单优惠项目设置分页
	 */
	fun getItemPayDiscountRulePage(
		page: Page<PayCustomerOrderItemDiscountRule>,
		vo: PayCustomerOrderItemDiscountRuleSelectVo
	): Page<PayCustomerOrderItemDiscountRule>

	/**
	 * 获取订单优惠项目列表
	 */
	fun getItemPayDiscountRuleList(vo: PayCustomerOrderItemDiscountRuleSelectVo): List<PayCustomerOrderItemDiscountRule>

	/**
	 * 获取当前正在启用的项目优惠
	 */
	fun getNowOpenItemDiscountRuleList(
		subCompanyId: Long,
		type: ItemRuleTypeEnum?
	): List<PayCustomerOrderItemDiscountRule>


	/**
	 * 添加订单优惠
	 */
	fun addOrderPayDiscountRule(rule: PayOrderDiscountRule): ResponseBody

	/**
	 * 获取订单优惠设置分页
	 */
	fun getOrderPayDiscountRulePage(
		page: Page<PayOrderDiscountRule>,
		vo: PayOrderDiscountRuleSelectVo
	): Page<PayOrderDiscountRule>

	/**
	 * 获取订单优惠列表
	 */
	fun getOrderPayDiscountRuleList(vo: PayOrderDiscountRuleSelectVo): List<PayOrderDiscountRule>

	/**
	 * 获取当前正在启用的订单优惠
	 */
	fun getNowOpenOrderDiscountRuleList(subCompanyId: Long, type: OrderRuleTypeEnum?): List<PayOrderDiscountRule>


	/**
	 * 添加收费项目类型
	 */
	fun addPayItemType(type: SysCompanyPayItemType): ResponseBody

	/**
	 * 删除费项目类型
	 */
	fun delPayItemType(typeId: Long): ResponseBody

	/**
	 * 删除收费项目
	 */
	fun delPayItem(id: Long): ResponseBody

	/**
	 * 获取配置
	 */
	fun getOtherConfig(subCompanyId: Long):CompanyDeptOtherConfig?

	/**
	 * 订单抬头
	 */
	fun getOrderPrintTitle(subCompanyId: Long):String

	/**
	 * 订单收欠款抬头
	 */
	fun getOweOrderPrintTitle(subCompanyId: Long):String

	/**
	 * 配置中（营业时间显示） 默认8点 - 18点
	 */
	fun getOtherConfigWorkTimeStr(subCompanyId: Long):String

	/**
	 * 添加短信模板类型
	 */
	fun addSmsModelType(type: CompanySmsModelType):ResponseBody

	/**
	 * 获取短信模板类型列表
	 */
	fun getSmsModelTypeList(subCompanyId: Long):List<CompanySmsModelType>

	/**
	 * 创建随访模版
	 */
	fun createAccessLogModel(model:SickCustomerAccessLogModel):ResponseBody

	/**
	 * 获取随访模版分页
	 */
	fun getAccessLogModelPage(vo: SickCustomerAccessLogModelSelectVo):Page<SickCustomerAccessLogModel>

	/**
	 * 获取随访模版列表
	 */
	fun getAccessLogModelList(vo: SickCustomerAccessLogModelSelectVo):List<SickCustomerAccessLogModel>

	/**
	 * 删除模版
	 */
	fun delAccessLogModel(id: Long):ResponseBody

	/**
	 * 添加一个病历模板类型
	 */
	fun addMedicalHistoryModelType(modelType: CompanyUserMedicalHistoryModelType):ResponseBody


	/**
	 * 获取病历模板   类型列表 - 类型下 模板列表格式
	 */
	fun getMedicalHistoryTypeModelList():MutableList<CompanyUserMedicalHistoryModelType>

	/**
	 * 获取病历模板类型列表
	 */
	fun getMedicalHistoryTypeList():MutableList<CompanyUserMedicalHistoryModelType>

	/**
	 * 获取技加工工厂下拉框
	 */
	fun getTechnologyPlantList(companyId: Long):List<TechnologyProcessingPlant>


}
